import markdown from '@eslint/markdown'
import { FlatConfig } from '../types'

export default async (): Promise<FlatConfig[]> => [
  {
    name: 'vill-v/markdown/setup',
    plugins: {
      markdown,
    },
  },
  {
    name: 'vill-v/markdown/processor',
    files: ['**/*.md'],
    processor: markdown.processors.markdown,
  },
  {
    name: 'vill-v/markdown/rules',
    files: ['**/*.md/**'],
    languageOptions: {
      parserOptions: {
        ecmaFeatures: {
          impliedStrict: true,
        },
      },
    },
    rules: {
      'no-undef': 'off',
      'no-unused-expressions': 'off',
      'no-unused-vars': 'off',
      strict: 'off',
      'unicode-bom': 'off',
      'no-alert': 'off',
      'no-console': 'off',
      'no-restricted-imports': 'off',
      'import/no-unresolved': 'off',
      '@typescript-eslint/no-redeclare': 'off',
      '@typescript-eslint/no-unused-vars': 'off',
      '@typescript-eslint/no-use-before-define': 'off',
      '@typescript-eslint/no-require-imports': 'off',
      '@typescript-eslint/comma-dangle': 'off',
    },
  },
]
